import React from 'react'
import { BrowserRouter, useRoutes } from 'react-router-dom'
const Home = React.lazy(() => import('../views/home'))
const Layout = React.lazy(() => import('../views/layout'))
const List = React.lazy(() => import('../views/list'))
const Login = React.lazy(() => import('../views/login'))

const routes = [{
	path: '/',
	element: <Layout></Layout>,
	children: [{
		path: '/',
		element: <Home></Home>
	},{
		path: '/list',
		element: <List></List>
	}]
}, {
	path: '/login',
	element: <Login></Login>
}]


const Router = () => {
	const App = () => useRoutes(routes)
	return (
			<BrowserRouter>
				<App></App>
			</BrowserRouter>
	)
}

export default Router